//
//  KTTagListView.h
//  JCTagListView
//
//  Created by 宽图 on 15/9/29.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, KTTagListItemArrangeDirection) {
    KTTagListItemArrangeDirectionLeftToRight,
    KTTagListItemArrangeDirectionRightToLeft
};


@protocol KTTagListViewDelegate;
@protocol KTTagListViewDataSource;

@interface KTTagListView : UIView

@property (nonatomic, weak)IBOutlet __nullable id<KTTagListViewDataSource>dataSource;
@property (nonatomic, weak)IBOutlet __nullable id<KTTagListViewDelegate>delegate;
- (void)reloadData;
@end

@protocol KTTagListViewDelegate <NSObject>

@optional

- (CGFloat)minimumHeightSpacingForRowInTagListView:(nullable KTTagListView *)tagListView;
- (CGFloat)minimumWidthSpacingForCellInTagListView:(nullable KTTagListView *)tagListView;
- (void)tagListView:(nullable KTTagListView *)tagListView willDisplayCell:(nullable UIButton *)button AtIndex:(NSInteger)index;
- (void)tagListView:(nullable KTTagListView *)tagListView didSelectAtIndex:(NSInteger)index;
- (UIEdgeInsets)edgetInsetsForTagListView:(nullable KTTagListView *)tagListView;
- (KTTagListItemArrangeDirection)itemArrangeDirectionOftagListView:(nullable KTTagListView *)taglistView;

@end

@protocol KTTagListViewDataSource <NSObject>

- (NSInteger)numberOfItemsInTagListView:(nullable KTTagListView *)tagListView;
- (nullable UIButton *)tagListView:(nullable KTTagListView *)tagListView cellAtIndex:(NSInteger)index;

@end
